package com.sduept.nwld.dataserver.rest;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.alibaba.fastjson.JSONObject;
import com.sduept.core.dao.SuperDAO;
import com.sduept.nwld.dataserver.manager.countanalyse.ProtectAnalysisManger;


/**
 * @author laiy
 */
@RestController
@RequestMapping("/measures/")
public class MeasuresServices {
	
	@Autowired
	private SuperDAO dao;
	@Autowired
	private ProtectAnalysisManger protectAnalysisManger;

	@GetMapping("/getCounterMeasures")
	public String getFaultDatasByGroupYearRankType1() {
		String jsonStr = protectAnalysisManger.getFaultDatasByGroupYearRankType();
		return  JSONObject.parse(jsonStr).toString();
	}
	
	/**
	 * 反措总体情况
	 * @param year
	 * @return[{order:1,name:'规范断路器本体三相不一致保护运行（调继〈2011〉6号）',finishRatio:98}]
	 */

	@GetMapping("/getAllCounterMeasures")
	public String getAllCounterMeasures() {
		String jsonStr = protectAnalysisManger.getAllCounterMeasures();
		return JSONObject.parse(jsonStr).toString();
	}
	

	@GetMapping("/getCompanyCounterMeasureDatas")
	public String getCompanyCounterMeasureDatas() {
		String jsonStr = protectAnalysisManger.getCompanyCounterMeasureDatas();
		return JSONObject.parse(jsonStr).toString();
	}
}
